Usually, Kotlin strings use standard quotation marks ("
) as delimiters. However,
then you need to escape certain characters to get the compiler to understand them,
such as \n
for a newline.
Raw strings use three quotation marks ("""
) as delimiters. These do not support
any type of escaped characters, but you can put anything you want in the string
literals, including newlines, as this snippet shows.
You can learn more about this in:
Tags: